<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>JpegSegmentData (Metadata-Extractor - JavaDoc - An Open Source Java Library for Image File Metadata)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="JpegSegmentData (Metadata-Extractor - JavaDoc - An Open Source Java Library for Image File Metadata)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/JpegSegmentData.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><a href='http://www.drewnoakes.com/code/exif/' title='Go to the project home page.'><img src='http://metadata-extractor.googlecode.com/git/Resources/metadata-extractor-logo-131x30.png' border=0 alt='Metadata Extractor Logo'></a></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/drew/imaging/jpeg/JpegProcessingException.html" title="class in com.drew.imaging.jpeg"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/drew/imaging/jpeg/JpegSegmentReader.html" title="class in com.drew.imaging.jpeg"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/drew/imaging/jpeg/JpegSegmentData.html" target="_top">Frames</a></li>
<li><a href="JpegSegmentData.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.drew.imaging.jpeg</div>
<h2 title="Class JpegSegmentData" class="title">Class JpegSegmentData</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.drew.imaging.jpeg.JpegSegmentData</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable</dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">JpegSegmentData</span>
extends java.lang.Object
implements java.io.Serializable</pre>
<div class="block">Holds a collection of Jpeg data segments.  This need not necessarily be all segments
 within the Jpeg.  For example, it may be convenient to store only the non-image
 segments when analysing (or serializing) metadata.
 <p/>
 Segments are keyed via their segment marker (a byte).  Where multiple segments use the
 same segment marker, they will all be stored and available.</div>
<dl><dt><span class="strong">Author:</span></dt>
  <dd>Drew Noakes http://drewnoakes.com</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../serialized-form.html#com.drew.imaging.jpeg.JpegSegmentData">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html#JpegSegmentData()">JpegSegmentData</a></strong>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html#addSegment(byte, byte[])">addSegment</a></strong>(byte&nbsp;segmentMarker,
          byte[]&nbsp;segmentBytes)</code>
<div class="block">Adds segment bytes to the collection.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html#containsSegment(byte)">containsSegment</a></strong>(byte&nbsp;segmentMarker)</code>
<div class="block">Determines whether data is present for a given segment marker.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html" title="class in com.drew.imaging.jpeg">JpegSegmentData</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html#fromFile(java.io.File)">fromFile</a></strong>(java.io.File&nbsp;file)</code>
<div class="block">Deserialises the contents of a JpegSegmentData from a file.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html#getSegment(byte)">getSegment</a></strong>(byte&nbsp;segmentMarker)</code>
<div class="block">Gets the first Jpeg segment data for the specified marker.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html#getSegment(byte, int)">getSegment</a></strong>(byte&nbsp;segmentMarker,
          int&nbsp;occurrence)</code>
<div class="block">Gets segment data for a specific occurrence and marker.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html#getSegmentCount(byte)">getSegmentCount</a></strong>(byte&nbsp;segmentMarker)</code>
<div class="block">Returns the count of segment data byte arrays stored for a given segment marker.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.util.List&lt;byte[]&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html#getSegmentList(byte)">getSegmentList</a></strong>(byte&nbsp;segmentMarker)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.Iterable&lt;byte[]&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html#getSegments(byte)">getSegments</a></strong>(byte&nbsp;segmentMarker)</code>
<div class="block">Returns all instances of a given Jpeg segment.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html#removeSegment(byte)">removeSegment</a></strong>(byte&nbsp;segmentMarker)</code>
<div class="block">Removes all segments from the collection having the specified marker.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html#removeSegmentOccurrence(byte, int)">removeSegmentOccurrence</a></strong>(byte&nbsp;segmentMarker,
                       int&nbsp;occurrence)</code>
<div class="block">Removes a specified instance of a segment's data from the collection.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html#toFile(java.io.File, com.drew.imaging.jpeg.JpegSegmentData)">toFile</a></strong>(java.io.File&nbsp;file,
      <a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html" title="class in com.drew.imaging.jpeg">JpegSegmentData</a>&nbsp;segmentData)</code>
<div class="block">Serialises the contents of a JpegSegmentData to a file.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="JpegSegmentData()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>JpegSegmentData</h4>
<pre>public&nbsp;JpegSegmentData()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="addSegment(byte, byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addSegment</h4>
<pre>public&nbsp;void&nbsp;addSegment(byte&nbsp;segmentMarker,
              byte[]&nbsp;segmentBytes)</pre>
<div class="block">Adds segment bytes to the collection.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>segmentMarker</code> - </dd><dd><code>segmentBytes</code> - </dd></dl>
</li>
</ul>
<a name="getSegment(byte)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSegment</h4>
<pre>public&nbsp;byte[]&nbsp;getSegment(byte&nbsp;segmentMarker)</pre>
<div class="block">Gets the first Jpeg segment data for the specified marker.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>segmentMarker</code> - the byte identifier for the desired segment</dd>
<dt><span class="strong">Returns:</span></dt><dd>a byte[] containing segment data or null if no data exists for that segment</dd></dl>
</li>
</ul>
<a name="getSegment(byte, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSegment</h4>
<pre>public&nbsp;byte[]&nbsp;getSegment(byte&nbsp;segmentMarker,
                int&nbsp;occurrence)</pre>
<div class="block">Gets segment data for a specific occurrence and marker.  Use this method when more than one occurrence
 of segment data for a given marker exists.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>segmentMarker</code> - identifies the required segment</dd><dd><code>occurrence</code> - the zero-based index of the occurrence</dd>
<dt><span class="strong">Returns:</span></dt><dd>the segment data as a byte[], or null if no segment exists for the marker & occurrence</dd></dl>
</li>
</ul>
<a name="getSegments(byte)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSegments</h4>
<pre>public&nbsp;java.lang.Iterable&lt;byte[]&gt;&nbsp;getSegments(byte&nbsp;segmentMarker)</pre>
<div class="block">Returns all instances of a given Jpeg segment.  If no instances exist, an empty sequence is returned.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>segmentMarker</code> - a number which identifies the type of Jpeg segment being queried</dd>
<dt><span class="strong">Returns:</span></dt><dd>zero or more byte arrays, each holding the data of a Jpeg segment</dd></dl>
</li>
</ul>
<a name="getSegmentList(byte)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSegmentList</h4>
<pre>public&nbsp;java.util.List&lt;byte[]&gt;&nbsp;getSegmentList(byte&nbsp;segmentMarker)</pre>
</li>
</ul>
<a name="getSegmentCount(byte)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSegmentCount</h4>
<pre>public&nbsp;int&nbsp;getSegmentCount(byte&nbsp;segmentMarker)</pre>
<div class="block">Returns the count of segment data byte arrays stored for a given segment marker.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>segmentMarker</code> - identifies the required segment</dd>
<dt><span class="strong">Returns:</span></dt><dd>the segment count (zero if no segments exist).</dd></dl>
</li>
</ul>
<a name="removeSegmentOccurrence(byte, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeSegmentOccurrence</h4>
<pre>public&nbsp;void&nbsp;removeSegmentOccurrence(byte&nbsp;segmentMarker,
                           int&nbsp;occurrence)</pre>
<div class="block">Removes a specified instance of a segment's data from the collection.  Use this method when more than one
 occurrence of segment data for a given marker exists.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>segmentMarker</code> - identifies the required segment</dd><dd><code>occurrence</code> - the zero-based index of the segment occurrence to remove.</dd></dl>
</li>
</ul>
<a name="removeSegment(byte)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeSegment</h4>
<pre>public&nbsp;void&nbsp;removeSegment(byte&nbsp;segmentMarker)</pre>
<div class="block">Removes all segments from the collection having the specified marker.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>segmentMarker</code> - identifies the required segment</dd></dl>
</li>
</ul>
<a name="containsSegment(byte)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>containsSegment</h4>
<pre>public&nbsp;boolean&nbsp;containsSegment(byte&nbsp;segmentMarker)</pre>
<div class="block">Determines whether data is present for a given segment marker.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>segmentMarker</code> - identifies the required segment</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if data exists, otherwise false</dd></dl>
</li>
</ul>
<a name="toFile(java.io.File, com.drew.imaging.jpeg.JpegSegmentData)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toFile</h4>
<pre>public static&nbsp;void&nbsp;toFile(java.io.File&nbsp;file,
          <a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html" title="class in com.drew.imaging.jpeg">JpegSegmentData</a>&nbsp;segmentData)
                   throws java.io.IOException</pre>
<div class="block">Serialises the contents of a JpegSegmentData to a file.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>file</code> - to file to write from</dd><dd><code>segmentData</code> - the data to write</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if problems occur while writing</dd></dl>
</li>
</ul>
<a name="fromFile(java.io.File)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>fromFile</h4>
<pre>public static&nbsp;<a href="../../../../com/drew/imaging/jpeg/JpegSegmentData.html" title="class in com.drew.imaging.jpeg">JpegSegmentData</a>&nbsp;fromFile(java.io.File&nbsp;file)
                                throws java.io.IOException,
                                       java.lang.ClassNotFoundException</pre>
<div class="block">Deserialises the contents of a JpegSegmentData from a file.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>file</code> - the file to read from</dd>
<dt><span class="strong">Returns:</span></dt><dd>the JpegSegmentData as read</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if problems occur while reading</dd>
<dd><code>java.lang.ClassNotFoundException</code> - if problems occur while deserialising</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/JpegSegmentData.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><a href='http://www.drewnoakes.com/code/exif/' title='Go to the project home page.'><img src='http://metadata-extractor.googlecode.com/git/Resources/metadata-extractor-logo-131x30.png' border=0 alt='Metadata Extractor Logo'></a></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/drew/imaging/jpeg/JpegProcessingException.html" title="class in com.drew.imaging.jpeg"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/drew/imaging/jpeg/JpegSegmentReader.html" title="class in com.drew.imaging.jpeg"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/drew/imaging/jpeg/JpegSegmentData.html" target="_top">Frames</a></li>
<li><a href="JpegSegmentData.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><i>Copyright &#169; 2003-2012 Drew Noakes. All Rights Reserved.</i>
<script src='http://www.google-analytics.com/urchin.js' type='text/javascript'></script>
<script type='text/javascript'>
_uacct = 'UA-936661-1';
urchinTracker();
</script></small></p>
</body>
</html>
